package com.aistar.order.mapper;


import com.aistar.order.entity.OrderInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * Created by Administrator on 2019/6/24 0024.
 */
public interface OrderInfoMapper {
    //   根据登录用户id 找到登录用户的常用取票人
    @Select("select * from order_info where user_id like concat('%',#{user_id},'%')")
    List<OrderInfo> findAll(String id);
    //   根据登录用户idCard 找到登录用户的常用取票人
    @Select("select * from order_info where id_card=#{idCard}")
    OrderInfo findByIdCard(String id);

    @Select("select * from order_info where id=#{id}")
    OrderInfo findById(String id);

    @Insert("insert into order_info values(#{id},#{name},#{idCard},#{phone},#{remarks},#{userId})")
    void save(OrderInfo orderInfo);

    @Delete("delete from order_info where id=#{id}")
    void delete(String id);

    @Update("update order_info set name=#{name},id_card=#{idCard},phone=#{phone} where id=#{id}")
    void update(OrderInfo orderinfo);

}
